package de.sordul.goldwaage.core;

import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class TextUtil {

	private static Log log = LogFactory.getLog(TextUtil.class);

	/**
	 * Exctracts the senctences from a string and returns them in form of a List<String>.
	 * 
	 * @param text The text to proccess
	 * @return It's sentences
	 */
	public static List<String> extractSentences(String text) {
		List<String> result = new ArrayList<String>();

		StringTokenizer st = new StringTokenizer(text, ".");
		while (st.hasMoreTokens()) {
			result.add(st.nextToken().trim());
		}

		return result;
	}

}
